package com.share.dgs.model;


import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * @author caifan
 * @created 2021/5/26
 * description:
 */
@Data
public class Person {

    @NotNull(message = "id不能为空")
    private Long id;

    @NotNull(message = "名称不能为空")
    private String name;

    @NotNull(message = "年龄不能为空")
    @Min(value = 1, message = "年龄必须大于0")
    @Max(value = 120, message = "年龄小于120岁")
    private Integer age;

    @NotEmpty(message = "地址不能为空")
    private String address;

}
